#pragma once
#include "OCMain/Thread/DefaultWorkQueue.h"

using namespace OCPP;

class MyWorkQueue : public RequestHandler, public ResponseHandler
{
public:
	enum RequestType
	{
		RT_Type1,
		RT_Type2,
	};

	struct TaskRequest
	{
		String					message;
		RequestType				type;
		friend std::ostream& operator<<(std::ostream& o, const TaskRequest& r)
		{
			(void)r; return o;
		}
	};

	MyWorkQueue(bool start = true);
	~MyWorkQueue();
	void startup();
	void processResponses();
	void addRequest(TaskRequest request, int priority = 0);
protected:
	CORE_AUTO_MUTEX;
	virtual Response* handleRequest(const Request* req, const WorkQueue* srcQ);
	virtual void handleResponse(const Response* res, const WorkQueue* srcQ);
	int					mWorkQueueChannel;
	DefaultWorkQueue	mDefaultWorkQueue;
};

